Skip to content

Adopt the common CI and tooling setup - #90

Open
dannywillems wants to merge 6 commits into
mainfrom
dw/common-ci-tooling
Open

Adopt the common CI and tooling setup#90
dannywillems wants to merge 6 commits into
mainfrom
dw/common-ci-tooling

Conversation

@dannywillems

Copy link
Copy Markdown
Contributor

Brings the client in line with the shared Python CI+tooling standard (the same setup as leakix-mcp).

Added

  • Coverage: pytest-cov + branch coverage, make coverage gate at 70% (current 73.5%), CI job.
  • Dependency audit: pip-audit (make audit) + CI job; no advisories.
  • Secret scanning: TruffleHog CI job.
  • Workflow SAST: zizmor (make zizmor) + a zizmor-action CI job (SARIF to code scanning). Every workflow hardened to pass zizmor with zero findings: SHA-pinned actions, least-privilege permissions, persist-credentials: false, and github context moved to env:.
  • SBOM: CycloneDX (make sbom) + release workflow.
  • nox (make test-all) and a mkdocs-material + mkdocstrings docs site (make docs).

Changed

  • Dependencies: all runtime and dev floors bumped to their latest releases (l9format stays pinned at 2.0.1); added hypothesis, cyclonedx-bom, nox, zizmor, mkdocs deps.
  • Ruff: expanded rule set (S, ASYNC, PT, PTH, PIE, RET, ARG, ERA, RUF, PL). Every finding was fixed, not ignored - notably request timeouts added to the sync client, and the examples/tests tightened. Only pytest assert (S101) stays exempt in tests.
  • mypy: strict enabled; the library passes with zero errors. Test functions are exempt from requiring annotations (standard pytest convention; tests/ made a package for the override).
  • Replaced the ad-hoc actions.yml CI with the standard ci.yml (lint, typecheck, test matrix 3.11-3.14, coverage, audit, secret-scan). The old CI also tested macOS/Windows; the common ci.yml is Ubuntu-only - flag if cross-platform CI should be retained.

Verification

make check green (format, lint, mypy strict, coverage 73.5%). make zizmor and make audit clean. make docs builds --strict.

Notes

  • uv.lock is gitignored in this repo (library), so the dependency bump is expressed via the pyproject floors.
  • The pr-hygiene "PR size" check will likely flag this as large (foundational tooling PR).

Bring the client in line with the shared Python CI+tooling standard:

- Dependencies: bump all runtime and dev floors to their latest releases
  (l9format stays pinned at 2.0.1); add hypothesis, cyclonedx-bom, nox,
  zizmor, mkdocs-material, and mkdocstrings.
- Ruff: expand the rule set (S, ASYNC, PT, PTH, PIE, RET, ARG, ERA, RUF,
  PL) and fix every finding rather than ignoring it, including adding
  request timeouts in the sync client and tightening the examples and
  tests. Only pytest asserts (S101) stay exempt in tests.
- mypy: enable strict; the library passes with zero errors. Test functions
  are exempt from requiring annotations (standard pytest convention).
- Coverage: pytest-cov with branch coverage and a 70% gate (make coverage).
- Makefile: add coverage, test-all (nox), audit, zizmor, sbom, and docs
  targets; check now runs coverage.
- Workflows: replace the ad-hoc CI with the standard ci.yml, and add
  zizmor.yml, sbom.yml, and shellcheck.yaml. Every workflow is hardened to
  pass zizmor: SHA-pinned actions, least-privilege permissions,
  persist-credentials false, and github context passed through env vars.
  Secret scanning uses TruffleHog.
- Docs: a mkdocs-material + mkdocstrings site (make docs).
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@dannywillems dannywillems left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-ACK

uv.lock was gitignored, so CI had no lockfile and uv sync re-resolved to
the latest (including the broken hypothesis 6.161.7). Commit the lock and
stop ignoring it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants